<%- bundle ||= statistics -%>
<div class="statistics">
  <%= link_to "#{image_tag("application_view_tile.png")} Compare", bundles_path, :class => "button" %>
  <h3>Statistics</h3>
  <br />
  <table cellspacing="0">
    <tr class="top">
      <th>Average</th>
      <th>This Group</th>
      <th>All Groups</th>
    </tr>
    <tr>
      <th>Credit Score</th>
      <td><%= credit_grade bundle.aggregates[:credit_score] %></td>
      <td><%= credit_grade current_user.bundle_aggregates[:credit_score] %></td>
    </tr>
    <tr>
      <th>Loan Amount</th>
      <td><%= amount_requested bundle.aggregates[:amount_requested] %></td>
      <td><%= amount_requested current_user.bundle_aggregates[:amount_requested] %></td>
    </tr>
    <tr>
      <th>Borrower APR</th>
      <td><%= percentage bundle.aggregates[:borrower_apr] %></td>
      <td><%= percentage current_user.bundle_aggregates[:borrower_apr] %></td>
    </tr>
    <tr>
      <th>Debt/Income</th>
      <td><%= percentage bundle.aggregates[:debt_to_income_ratio] %></td>
      <td><%= percentage current_user.bundle_aggregates[:debt_to_income_ratio] %></td>
    </tr>
    <tr>
      <th>Funding</th>
      <td><%= percentage bundle.aggregates[:percent_funded] %></td>
      <td><%= percentage current_user.bundle_aggregates[:percent_funded] %></td>
    </tr>
    <tr>
      <th>Bids</th>
      <td><%= bundle.aggregates[:bid_count] %></td>
      <td><%= current_user.bundle_aggregates[:bid_count] %></td>
    </tr>
  </table>
</div>  
